package org.wuyichun.gift.exception;
/*
    自定义异常:
        继承一个已知的异常类

 */

import org.wuyichun.gift.syscode.SystemErrorCode;

public class BusinessException extends RuntimeException{

    //错误码
    private String code;
    //错误描述
    private String msg;
    private SystemErrorCode systemErrorCode;

    public BusinessException( String msg) {
        super(msg);
        this.msg = msg;
    }

    public BusinessException() {
    }

    public BusinessException(String code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public BusinessException(SystemErrorCode systemErrorCode) {
        super(systemErrorCode.getMsg());
        this.code = systemErrorCode.getCode();
        this.msg = systemErrorCode.getMsg();
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
